package com.wang.cloud.manage.domain.co;

import com.wang.cloud.common.core.enums.GenderEnum;
import com.wang.cloud.common.core.validator.CheckEnum;
import com.wang.cloud.common.swagger.annotations.SchemaEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;

import java.util.List;


/**
 * @author wy
 * @since 2024-07-16
 */
@Getter
@Setter
@Schema(description = "系统管理用户-新增参数")
public class SysUserUpdateCo {

    @NotNull(message = "id不能为空")
    @Min(value = 1, message = "id不能小于1")
    @Schema(description = "数据ID")
    private Long id;

    @NotBlank(message = "请填写用户昵称")
    @Size(max = 15, message = "用户昵称不能超过15字符")
    @Schema(description = "用户昵称")
    private String nickName;

    @Email(message = "邮箱格式不正确")
    @Size(max = 50, message = "邮箱不能超过500字符")
    @Schema(description = "用户邮箱")
    private String email;

    @SchemaEnum(value = GenderEnum.class, required = false)
    @CheckEnum(value = GenderEnum.class, message = "性别错误", required = false)
    @Schema(description = "用户性别（0未知、1男 2女 ）")
    private Integer gender;

    @Size(max = 255, message = "头像地址不能超过255字符")
    @Schema(description = "头像地址")
    private String avatar;

    @NotBlank(message = "请选择帐号状态")
    @Pattern(regexp = "^[01]$", message = "帐号状态错误")
    @Schema(description = "帐号状态（0正常 1停用）")
    private String status;

    @Size(max = 500, message = "备注不能超过500字符")
    @Schema(description = "备注")
    private String remark;

    @Schema(description = "角色id列表")
    private List<Long> roleIds;

}
